<?php
declare (strict_types=1);

namespace app\common\validate;

class User extends BaseValidate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'username' => 'require|alphaDash|length:5,20',
        'password' => 'require|min:6',
    ];
    /**
     * 字段描述
     * @var array
     */
    protected $field = [
        'username'      => '账号',
        'password'      => '密码',
    ];

    protected $message = [
        'username.length' => '账号不能低于5位高于20位'
    ];
    /**
     * 场景规则
     * @var array
     */
    protected $scene = [
        'login' => [
            'username'=>'require',
            'password'=>'require',
        ],
    ];
}
